package com.cxyd.modules.wcs.controller;

import com.cxyd.common.page.PageData;
import com.cxyd.common.utils.Result;
import com.cxyd.modules.wcs.dto.LocateDTO;
import com.cxyd.modules.wcs.service.LocateService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("wcs/locate")
public class LocateController {
    private final LocateService locateService;

    public LocateController(LocateService locateService) {
        this.locateService = locateService;
    }

    @GetMapping("page")
    @RequiresPermissions("wcs:locate:page")
    public Result<PageData<LocateDTO>> page(@RequestParam Map<String, Object> params) {
        final PageData<LocateDTO> page = locateService.page(params);
        return new Result<PageData<LocateDTO>>().ok(page);
    }

    @DeleteMapping
    @RequiresPermissions("wcs:locate:delete")
    public Result delete(@RequestBody Long[] ids) {
        return new Result();
    }
}
